<!DOCTYPE html>
<html lang="en">
<head>
	
	<!-- start: Meta -->
	<meta charset="utf-8" />
	<title>WCMS 登录</title>
	<meta name="description" content="SimpliQ - Flat & Responsive Bootstrap Admin Template." />
	<meta name="author" content="Łukasz Holeczek" />
	<meta name="keyword" content="SimpliQ, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina" />
	<!-- end: Meta -->
	
	<!-- start: Mobile Specific -->
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<!-- end: Mobile Specific -->
	
	<!-- start: CSS -->
	<link href="/static/bootstrap2/css/bootstrap.min.css" rel="stylesheet" />
	<link href="/static/bootstrap2/css/bootstrap-responsive.min.css" rel="stylesheet" />
	<link href="/static/bootstrap2/css/style.min.css" rel="stylesheet" />
	<link href="/static/bootstrap2/css/style-responsive.min.css" rel="stylesheet" />
	<link href="/static/bootstrap2/css/retina.css" rel="stylesheet" />
	<link href="/static/bootstrap2/css/my.css" rel="stylesheet" />
	<!-- end: CSS -->
	

	<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	  	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<link id="ie-style" href="css/ie.css" rel="stylesheet">
	<![endif]-->
	
	<!--[if IE 9]>
		<link id="ie9style" href="css/ie9.css" rel="stylesheet">
	<![endif]-->
	
	<!-- start: Favicon and Touch Icons -->
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png" />
	<link rel="shortcut icon" href="ico/favicon.png" />
	<script src="../../static/public/jquery-1.8.3.min.js" type="text/javascript" ></script>
	
	<!-- end: Favicon and Touch Icons -->	
		
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{literal}
<style type="text/css">
body{background:#666;}
</style>
{/literal}
</head>

<body>
		<div class="container-fluid-full">
		<div class="row-fluid">
					
			<div class="row-fluid">
				<div class="login-box">
				{if $user.username==""}
				
					<h2>用户登录</h2>
					<form class="form-inline" action="#" method="post" />
						<fieldset>
					
							<input class="input-large span12" name="mobile" id="username" type="text"  value="15800000000" />
    
					
							<input class="input-large span12" name="password" id="password" type="password" value="123456" />
   <input type="hidden" name="type" value="admin">
<input type="text" name="codeimg" id="verifyCode" class="input-large span6" value="" />
  <img src="/anonymous/validate" id="verifyImg"  /><span class="tips"><a href="#" id="cap_resend" onclick="fleshVerify()"> 换一个</a></span>
							<div class="clearfix"></div>
							
							<label class="remember" for="remember"><input type="checkbox" id="remember" />记住我</label>
							
							<div class="clearfix"></div>
							
							<button type="button"  onclick="return logincheck()"  class="btn btn-success span12">登录</button>
						</fieldset>	
					</form>
					{else}
					{$user.username}|
					<a href="/factory/config">后台管理</a>
					{/if}
					<hr />
					<h3>忘记密码?</h3>
					<p>
						No problem, <a href="#">click here</a> to get a new password.
					</p>	
				</div>
			</div><!--/row-->
			
				</div><!--/fluid-row-->
				
	</div><!--/.fluid-container-->

{literal}
<script language="javascript">
function logincheck() {
	var passwd= $("input[name='password']").val();
	var mobile = $("input[name='mobile']").val();
	var code= $("input[name='codeimg']").val();
                 if(mobile.length!=11){
               alert("手机号码应该为11位，请检查号码是否正确");
              return false;
        }


    	if (passwd.length <= 0) {
		alert("密码不能为空");
		return false;
	}

	if(code.length!=4){
	  alert("验证码填写错误");
	  return false;
	}

	$.post("/anonymous/check", {
		password: passwd,
		mobile_phone: mobile,
		codeimg:code
	}, function(data) {

                  if(data.status==false){
		alert(data.message);
                    return false;
                  }else{
                      location.reload();
                  }
	}, "json");
	
     //     location.reload();
	return false;

}


		 function fleshVerify(){
			//重载验证码
			    var timenow = new Date().getTime();
			    document.getElementById('verifyImg').src= '/anonymous/validate/?'+timenow;
			}
            </script>
{/literal}
</body>
</html>